<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <title>demo</title>
    <link rel="stylesheet" href="/Public/Home/css/calendar.css" type="text/css"/>
    <link rel="stylesheet" href="/Public/Home/css/amazeui.css" type="text/css"/>
</head>
<body>


        <div class="am-tabs" data-am-tabs="{noSwipe: 1}" id="doc-tab-demo-1">
            <ul class="am-tabs-nav am-nav am-nav-tabs">
                <li class="am-active"><a href="javascript: void(0)">课程1</a></li>
                <li><a href="javascript: void(0)">课程2</a></li>
                <li><a href="javascript: void(0)">课程3</a></li>
            </ul>

            <div class="am-tabs-bd">
                <div class="am-tab-panel am-active">
                    <div style="width:400px;margin: 0 auto;" id="calendar" class="calendar"></div>
                    <button style="margin: 0 auto;" type="button" class="am-btn am-btn-primary am-active">已激活</button>
                </div>
                <div class="am-tab-panel">
                    <div style="width:400px;height:300px;margin: 0 auto;" id="calendar2" class="calendar"></div>
                    <button type="button" class="am-btn am-btn-default" disabled="disabled">未激活</button>
                </div>
                <div class="am-tab-panel">
                    <div style="width:400px;height:300px;margin: 0 auto;" id="calendar3" class="calendar"></div>
                    <button type="button" class="am-btn am-btn-default" disabled="disabled">未激活</button>
                </div>
            </div>
        </div>


        <div class="am-modal am-modal-no-btn" tabindex="-1" id="curse-block">
            <div class="am-modal-dialog">
                <div class="am-modal-hd jtitle">

                </div>
                <div class="am-modal-bd jbody">
                </div>
                <div class="am-modal-bd jlink">
                </div>
            </div>
        </div>
</body>
<script src="/Public/Home/js/jquery.min.js"></script>
<script>
    $(function(){
        //ajax获取日历json数据
        var myDate = new Date();
        var signList=[{"signDay":myDate.getDate()}];
        calUtil.init(signList);
        $(".today").on("click",function(){
            $flag = $(this).parent().parent().parent().parent().parent().parent().attr("id");
            var closeStr = '<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>';
            if($flag != 'calendar'){
                $(".jtitle").html('警告'+closeStr);
                $(".jbody").html("此课程还没有激活!");
                $(".jlink").html("");
                return true;
            }
            $.ajax({
                url:"/Demo/getCourse",
                data:{uid:2},
                dataType:'json',
                success:function(data){
                    if(data.status == 1){
                        $(".jtitle").html(data.title+closeStr);
                        $(".jbody").html(data.description);
                        $(".jlink").html("<a href='"+data.content+"' target='_blank'>点击观看视频</a>");
                    }else{
                        alert('Hey!没数据.');
                    }
                }
            });
        });
    });
</script>
<script src="/Public/Home/js/calendar.js"></script>
<script src="/Public/Home/js/amazeui.min.js"></script>
</html>